#if 0
#include <stdio.h>

int main()
{
	int arr[] = { 2,1,8,4,5,9,7,3,6 };
	int length = sizeof(arr) / sizeof(int);

	for (size_t i = 0; i < length; i++)
	{
		int minNum = arr[i], minIndex = i;
		for (size_t j = i + 1; j < length; j++)
		{
			if (minNum > arr[j])
			{
				minNum = arr[j];
				minIndex = j;
			}
		}
		if (i != minIndex)
		{
			int num = arr[i];
			arr[i] = arr[minIndex];
			arr[minIndex] = num;
		}

	}
	for (size_t i = 0; i < length; i++)
	{
		printf("%d\n", arr[i]);
	}
	printf("end\n");
	getchar();
	return 0;
}
#endif // 0
